<template>
	<view class="list-box">
		<view class="list-box-content" v-if="slist" v-for="(item,index) in slist" :key="index">
			<view class="list-box-info zhengwen1" @click="tongjixiangqing(item.sno)">
				<view class="s-name">
					{{item.name}}
				</view>
				<view class="s-number">
					学号：{{item.sno}}
				</view>
				<view class="s-text">
					统计信息 >>
				</view>
			</view>
		
		</view>
		
	</view>
</template>

<script>
	export default{
		props:['banji'],
		data(){
			return{
				slist:[],
				id:''
			}
		},
		methods:{
			tongjixiangqing(id){
				console.log("进入学生详情")
				uni.navigateTo({
					url: '/pages/tongjixiangqing/tongjixiangqing?id='+id
				});
			}
		},

		mounted(){
			console.log("111"+this.banji)
			// 请求接口 ↓↓↓
			// 查询教师端每个班级下请假情况
			uni.request({
				// url: "/api/appteacher/getLeaveAllStudentOfTeacherStatistics",
				url: this.baseUrl+ "/appteacher/getLeaveAllStudentOfTeacherStatistics?satoken="+uni.getStorageSync('satoken'),
				method: "POST",
				headers: {
					// "token": localStorage.getItem("token")
				},
				data: {
				        class_id: this.banji
				    },
				success:(res) => { 
					console.log('班级请假信息')
					console.log(res.data.list)
					this.slist = res.data.list
				}
			})
		}
	}
</script>

<style lang="scss">
	@import url(@/static/common.css);
	.list-box{
		width: 100%;
		box-sizing: border-box;
		overflow: hidden;
		.list-box-content{
			width: 95%;
			margin: 0 auto;
			box-sizing: border-box;
			overflow: hidden;
			display: flex;
			flex-direction: column;
			.list-box-info{
				width: 100%;
				box-sizing: border-box;
				overflow: hidden;
				display: flex;
				flex-direction: row;
				padding: 30rpx 0;
				border-bottom: 1rpx solid #999999;
				.s-name{
					flex: 1;
				}
				.s-number{
					flex: 2;
				}
				.s-text{
					flex: 1;
				}
			}
		}
	}
</style>